home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / Premiere 4.2 SDK r3 Mac / Examples / .h files / PremiereBasic.h < prev    next >
Text File  |  1996-01-25  |  41KB  |  1,082 lines

  1. //========================================================================================
  2. //
  3. // PremiereBasic.h - Adobe Premiere¬ include file.
  4. //
  5. // Part of the Adobe Premiere¬ 4.2 Plug-In Developer's Toolkit.
  6. //
  7. // Header file written 10/20/93 by Bryan K. ╥Beaker╙ Ressler.
  8. //
  9. // Copyright ⌐ 1992-96, Adobe Systems Incorporated, all rights reserved worldwide.
  10. //
  11. // Version    1.00    10/20/93    Original version.
  12. // Version    1.01    9/12/94        Updated for 4.0.
  13. // Version  1.02    11/6/95     Updated for Premiere 4.2 and CodeWarrior7 - several new
  14. //                                globals, see the 4.2 comments below.
  15. //
  16. //========================================================================================
  17.  
  18. // NOTE: When this file is included by a CodeWarrior project which compiles to 68k code,
  19. // you must turn on MPW C Calling Conventions in the 68K preferences section
  20.  
  21. // START~ Defs-Globals
  22.  
  23. pascal long GetAGlobal (long identifier);
  24. pascal void SetAGlobal (long identifier, long value);
  25.  
  26. //╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  27. // This is the list of Globals which can be requested.
  28.  
  29. enum {
  30.     gAppVersion = 0,    // long                Version of Premiere which is running
  31.     gSysVersion,        // long                System software version
  32.  
  33.     gHDLRMethods,        // MethodArrayHand    list of HDLR modules
  34.     gDrawMethods,        // MethodArrayHand    list of Draw modules
  35.  
  36.     gImageFilters,        // short**            list of all video filters
  37.     gImageValues,        // long**            list of 'globals' for all filters
  38.     gAudioFilters,        // short**            list of all audio filters
  39.     gExportModules,        // short**            list of all export modules
  40.     gZoomModules,        // short**            list of zoom modules
  41.     gDeviceModules,        // short**            list of device control modules
  42.  
  43.     gHDLRModules,        // WindTypeHand        list of 'file' HDLR modules
  44.     gCaptureModules,    // WindTypeHand        list of 'Capture' HDLR modules
  45.     gToolModules,        // WindTypeHand        list of 'Tool' HDLR modules
  46.  
  47.     gFileList,            // FileHand            file queue handle
  48.     gFrameHead,            // FrameHand        frame queue head handle
  49.     gFrameTail,            // FrameHand        frame queue tail handle
  50.     gClipList,            // ClipHand            clip queue handle
  51.  
  52.     gNextID,            // long                next file/clip ID to be assigned
  53.     gUntitledID,        // long                next untitled file number
  54.  
  55.     gScrapClip,            // long                clip which is/was on the scrap
  56.  
  57.     gXREFs,                // XREFHand            handle to the cross reference table
  58.  
  59.     gPrefRate,            // long                default frame rate
  60.     gCurRate,            // long                frame rate
  61.  
  62.     gMidiFlags,            // long                MIDI configuration flags
  63.     gMidiInit,            // long                is MIDI initialized?
  64.     gMidiRef,            // long                MIDI port ref num
  65.     gTimeTask,            // TMTask*            pointer to time manager task for MIDI
  66.     gInterval,            // long                interval for above task
  67.     gTempo,                // long                tempo for above task
  68.     
  69.     gMinAudio,            // long                minimum audio timescale before 'greeking'
  70.     gAudioCompare,        // long                fractional value used with above
  71.  
  72.     gScrapCount,        // long                last scrap count
  73.  
  74.     gDontInterrupt,        // long                flag to prevent redraw interrupt
  75.  
  76.     gOpenedProj,        // long                set if we've opened a project
  77.     gJustPrinted,        // long                set if we just printed a file
  78.  
  79.     gDone,                // long                set if we should quit
  80.  
  81.     gResFileNum,        // long                resource file number of Premiere
  82.  
  83.     gStillDefault,        // long                default length (in frames) for stills
  84.  
  85.     gPluginVRefNum,        // long                vRefNum of plug-ins folder
  86.     gPluginDirID,        // long                dirID of plug-ins folder
  87.     
  88.     gWorkVRefNum,        // long                vRefNum of scratch disk
  89.     gWorkDirID,            // long                dirID of plug-ins folder
  90.  
  91.     gTempVRefNum,        // long                vRefNum of the application
  92.     gTempDirID,            // long                dirID of the application
  93.     
  94.     gPrefVRefNum,        // long                vRefNum of the prefs file
  95.     gPrefDirID,            // long                dirID of the prefs file
  96.     
  97.     gPrintRec,            // THPrint            print record
  98.     
  99.     gGWStrip,            // GWorldPtr        strip buffer
  100.     
  101.     gIconWorld1,        // GWorldPtr        contains cyan 'A'
  102.     gIconWorld2,        // GWorldPtr        contains yellow 'B'
  103.     gIconWorld3,        // GWorldPtr        stores result of effects
  104.     gSmallWorld,        // GWorldPtr        8 bit version of above
  105.     
  106.     gIcon_A,            // Handle            cyan 'A' in handle form
  107.     gIcon_B,            // Handle            cyan 'B' in handle form
  108.     
  109.     gOneBitWorld,        // GWorldPtr        general purpose 512x256 1-bit deep
  110.     gThumbWorld,        // GWorldPtr        thumbnail sized GWorld
  111.     
  112.     gClipFlag,            // long                flag to skip recursive updates
  113.     gSkipAll,            // long                flag to skip all remaining files
  114.     
  115.     gCursors,            // CCursList        list of all of our color cursors
  116.     
  117.     gCodecList,            // CodecNameSpecListPtr        QuickTime codec name list
  118.     
  119.     gBadFiles,            // short**            list of missing files
  120.     
  121.     gNetRec,            // NetBlock*        network protection data block
  122.     
  123.     gRGB2Y,                // unsigned char*    luminance lookup table pointer
  124.     gRGB2UV,            // short*            chrominance lookup table pointer
  125.     
  126.     gBlips,                // BlipRec*            sound mixing temporary buffers
  127.     gLevels,            // LevelRec*        table for mixing 8 bit sound
  128.     gAudioLimit,        // unsigned char*    clipping table for 8 bit audio
  129.     
  130.     gDecimalPt,            // long                decimal point character
  131.     gTimeSep,            // long                separator for time values
  132.     gFrameSep,            // long                separator for frame values
  133.     
  134.     gMultiply,            // unsigned char*    8x8 multiply lookup table
  135.     
  136.     gCurDevice,            // long                currently selected device control
  137.     gDeviceState,        // long                0=available, 1=in use
  138.     gDeviceData,        // Handle            current device handle
  139.     gDeviceName,        // char*            pointer to current device name
  140.     
  141.     gZoomInfo,            // Handle            storage used by zoom code
  142.     
  143.     gSpecialRate,        // long                special rate for audio conversion
  144.     
  145.     gHasOutline,        // long                set if we have TrueType
  146.     
  147.     gGlobalCancel,        // long                global cancel flag
  148.     
  149.     gScrapGroup,        // ClipGroupHand    current group on the scrap, or nil
  150.     
  151.     gWorkWorld,            // GWorldPtr        non-zero if GetVideo can use this
  152.     
  153.     gBottleNecks,        // BottleRec*        bottleneck record
  154.     
  155.     gUndoState,            // long                current undo state
  156.     
  157.     gLastMouse,            // Point            last mouse position
  158.     gLastKeys,            // long                last modifier keys
  159.     
  160.     gExitToShell,        // long                old ExitToShell trap value
  161.     
  162.     gTakeID,            // long                fileID of the 'TAKE' transition
  163.     
  164.     gMaxWidth,            // long                maximum width for an image
  165.     gMaxHeight,            // long                maximum height for an image
  166.     
  167.     gClipControl,        // long                type of controller for clip windows
  168.     gTreadWorld,        // GWorldPtr        filled with the 'Tractor Tread' pattern
  169.     
  170.     gFunctions,            // FuncList*        function key lookup table
  171.     
  172.     gRecursDepth,        // long                maximum recursion depth
  173.     gDontFlush,            // long                set to prevent audio data flushing
  174.     gLayerMode,            // long                video filter application for layers
  175.     gLayerBars,            // long                set to show layers as bars
  176.     gCollapseClips,        // long                set to open QT clips collapsed
  177.     gSafeLayers,        // long                set to enable safe layers
  178.     gOpenAction,        // long                selects action at startup
  179.     gDoInitCursor,        // long                set to force init cursors
  180.     gPickerType,        // long                color picker type
  181.     gLockStillAspect,    // long                initial aspect state for stills
  182.     gBit16OK,            // long                set if 16-bit audio is OK
  183.     gNoAccel,            // long                set to disable QT acceleration
  184.     gKillAppleTalk,        // long                set to kill AppleTalk on capture
  185.     gKilledAppleTalk,    // long                set if Appletalk has been killed
  186.     
  187.     gLastMenuID,        // long                the last menu ID we used
  188.     gLastMenu,            // MenuHandle        the last menu we used
  189.     
  190.     gShowFree,            // long                set to show disk free space
  191.     gShowFind,            // long                set to show find buttons
  192.     gNoZooming,            // long                set to disable clip zooming
  193.     
  194.     gMinDiskSpace,        // long                minimum disk space allowed before warning
  195.     
  196.     gAudioSkew,            // Ptr                gamma table for audio display
  197.     gAudioStraight,        // Ptr                linear lookup table for audio
  198.     
  199.     gAudioVolume,        // long                volume number for audio temp files
  200.     gVideoVolume,        // long                volume number for video temp files
  201.     
  202.     gScrubAmount,        // long*            ptr to a long, set to cause scrubbing
  203.     
  204.     gHackList,            // HackRec**        list of data types to merge together
  205.     
  206.     gSysWindow,            // WindowPtr        pointer to the 'HIDE' window
  207.     
  208.     gVideoZoom,            // long                zoom/unzoom state for print to video
  209.     gZoomMethod,        // long                hardware/software zooming
  210.     gVideoLoop,            // long                loop print to video
  211.     gVideoDelay,        // long                start/end amount to delay
  212.     
  213.     gPrefTemp,            // long                storage used by prefs dialog
  214.     
  215.     gXOutPrefs,            // OutPrefRec*        default output options record
  216.     gDITLItem,            // long                last original DITL item
  217.     
  218.     gTicks,                // long                the current system TICKS value
  219.     gWindowList,        // WindowPtr        the First window in the window list
  220.     gWMgrPort,            // GrafPtr            main window manager port
  221.     gDoubleTime,        // long                current double click time
  222.     gSFSaveDisk,        // long                current drive used by standard file
  223.     gCurDirStore,        // long                current directoty used by standard file
  224.     gPaintWhite,        // long                current value of the 'PaintWhite' flag
  225.     gGrayRgn,            // long                system GrayRgn
  226.     gMenuList,            // MenuListHand        system menu list
  227.     
  228.     gFontLookup,        // FontMapHand        list of font name/sizes
  229.     
  230.     gPlugInDate,        // long                Plug-in modification date checksum
  231.     gPlugInName,        // long                Plug-in name checksum
  232.     
  233.     gMenuCommand,        // long                Set to execute a menu command
  234.     gMenuModifiers,        // long                The modifiers for the command above
  235.     
  236.     gMenuToCommand,        // MenuMapHand        menuID to command number lookup
  237.     gCommandToMenu,        // MenuMapHand        command number to menuID lookup
  238.     
  239.     gMenuBitsList,        // MenuBitsHand        list of menu dimming bits
  240.     
  241.     gAutoSaveTime,        // long                number of minutes between auto-saves
  242.     gLastAutoSave,        // long                last tick count when auto-save occurred
  243.     
  244.     gScrubRez,            // long                scrubbing scale factor, powers of 2
  245.     
  246.     gTickNumer,            // long                Numerator for gTicks scale - 6014
  247.     gTickDenom,            // long                Denominator for above - 100
  248.     
  249.     gLeanMode,            // long                1=Use OSEvent calls in main loop
  250.     
  251.     gSaveRef,            // long                temporary storage for some routines
  252.     
  253.     gDeskCPat,            // PixPatHandle        Desktop pattern
  254.     
  255.     gAlertSystem,        // AlertSysProcPtr    Alternate function to handle AlertSystem calls
  256.     gAlertTemp,            // long                Temp location for function above
  257.     
  258.     gColorBars,            // long                time for color bars display
  259.     gScreenMode,        // long                screen mode to switch to for print to video
  260.     
  261.     gExternalList,        // long**            List of external module types
  262.     
  263.     gqd,                // QDGlobals *        pointer to app's A5 QD globals record
  264.     gUPPBottleNecks,    // UPPBottleRec *    like gBottleNecks except with UPPs
  265.     
  266.     gExportRef,            // long                temp storage for export modules
  267.     gDrawRef,            // long                temp storage for Draw modules
  268.     gInternalRef,        // long                temp storage for Internal routines
  269.     
  270.     gExtendedFuncs,        // long                bits for activating hidden functionality
  271.     
  272.     gDeskPat,            // long                B&W Desktop pattern
  273.     
  274.     gMouseNotDown,        // long                set to 1 if PrStillDown should return false
  275.     
  276.     gLogFades,            // long                set to 1 to use log scale in audio fading
  277.     
  278.     gQTVers,            // long                QuickTime version
  279.     
  280.     gAudioPreviewSecs,    // long                number of seconds to provide for audio previews
  281.     
  282.     gConnectionCount,    // long                number of open CFM connections on PPC
  283.     
  284.     gHaveDragAndDrop,    // long                true if we have the drag & drop manager
  285.     
  286.     gParserModules,        // short**            list of plug-in parsers
  287.     
  288.     gEnhancedRate,        // long                set to perform enhanced rate conversion
  289.     gProcessAudioAt,    // long                set to process audio internally at higher rate
  290.     gProcessAudioBits,    // long                0 = 8 bits, 1 = 16 bits
  291.     gProcessAudioRate,    // long                rate to process audio at
  292.     
  293.     gBottleStorage,        // Ptr to long[n]    storage for bottlenecks
  294.     
  295.     gQTScrub,            // long                set to use scrub mode for QT movies
  296.     
  297.     gCacheLimit,        // long                if non-zero, max number of frames allowed in cache
  298.     
  299.     gMovieSave,            // long                set when a movie is captured
  300.     
  301.     gAddVidProc,        // ProcPtr            Points to an alternate routine for processing frames
  302.  
  303.     // 4.2 changes -- njs
  304.     gProjOpenFunc,        // ProcPtr            Helper function for project opening status bar
  305.     gProjOpenStats,        // Ptr                Points to a struct that supports the project opening
  306.                         //                     status bar. 
  307.                         //                    Struct is defined in PremierePrivate.h
  308.                         //                    Used in HDLR-COMP-SAVE and SUBS-SAVE
  309.  
  310.     gAppSuspended,        //                    non-zero means we're in the background.
  311.                         //                    currently only used in Main.c in MainEvent() code...
  312.  
  313.     gBestResize,        //                    non-zero means do high quality downsizing from DRAW modules
  314.     gPreDeinterlace,    //                    non-zero means deinterlace at full size from DRAW modules
  315.     
  316.     gVidFilterData,        //                    handle to instance data for all active filters in a compile
  317.     gAudFilterData,        //                    handle to instance data for all active filters in a compile
  318.     
  319.     gCompileErr,        //                    Global that a plugin can set if it couldn't render and we should stop compiling.
  320.                         //                     fill this in with the error the plugin got rendering (probably out of memory).
  321.     
  322.     gRenderFunc,        //                    New plugin rendering function. See RenderStruct def for more info
  323.     
  324.                         //                    These next two are a hack to fix a problem with QuickTime:
  325.     gLastMoovID,        //                       Last QT movie that was drawn
  326.     gLastMoovFrame,        //                       Last QT movie frame that was drawn
  327.     // 4.2 changes -- njs -- end
  328.     
  329.     gLastGlobal            // THE LAST GLOBAL
  330. };
  331.  
  332. // Extended Functionality Bits
  333.  
  334. enum {
  335.     exfuncConstTools        =        1 << 0,
  336.     exfuncPopupActions        =        1 << 1,
  337.     exfuncKeyMovieStop         =        1 << 2,
  338.     exfuncWaveformExtra        =        1 << 3,
  339.     exfuncShowMotionPath    =        1 << 4,
  340.     exfuncAllowOffline        =        1 << 5,
  341.     exfuncEmbossStyle        =        1 << 6,
  342.     exfuncNoHalfSizes        =        1 << 7,
  343.     exfuncFrameBlending        =        1 << 8,
  344.     exfuncFlattenMovie        =        1 << 9,
  345.     exfuncSpaceIsPlay        =        1 << 10,
  346.     exfuncAutoFade            =        1 << 11,
  347.     exfuncStickyWindows        =        1 << 12
  348. };
  349.  
  350. // START~ Timecode
  351.  
  352. #define FRPH        108000L        /* frames per hour */
  353. #define DFRPH        107892L        /* drop frames per hour */
  354. #define FRPTM        18000        /* frames per ten minutes */
  355. #define DFRPTM        17982        /* drop frames per ten minutes */
  356. #define FRPM        1800        /* frames per minute */
  357. #define DFRPM        1798        /* drop frames per minute */
  358. #define FRPS        30            /* frames per second */
  359. #define DF24H        2589408L    /* drop frames per 24 hours */
  360. #define F24H        2592000L    /* frames per 24 hours */
  361. #define PAL_FRPH     90000L        /* PAL frames per hour */
  362. #define PAL_FRPTM     15000        /* PAL frames per 10 minutes */
  363. #define PAL_FRPM    1500        /* PAL frames per minute */
  364. #define PAL_FRPS    25            /* PAL frames per second */
  365. #define PAL_F24H    2160000L    /* PAL frames per 24 hours */
  366. #define FILM_FRPS    24
  367. #define FILM_FRPM    1440
  368. #define FILM_FRPTM    14400
  369. #define FILM_FRPH    86400L
  370. #define FILM_F24H    2073600L
  371.  
  372. #ifndef false
  373.     #define false 0
  374. #endif
  375.  
  376. #ifndef true
  377.     #define true 1
  378. #endif
  379.  
  380.     
  381. struct fields
  382. {
  383.     unsigned int una1:2, hours10:2, hoursu:4, una2:1, minute10:3, minuteu:4,
  384.                  fmark:1, second10:3, secondu:4, cf:1, df:1, frames10:2, framesu:4;
  385. };
  386.  
  387. #define DFBIT    0x40L        // corresponds to smpte->df
  388.  
  389. typedef union
  390. {
  391.      struct fields fields;    // the tens and units of each field can be accessed    
  392.     long time;                // the value can be accessed as one long integer    
  393. } smpte;
  394.  
  395. typedef struct
  396. {
  397.     long frames;            // binary frame count
  398.     char df;                // true = DF, false = NDF
  399.     char frameRate;            // PAL, NTSC, FILM
  400. } BIN_TC;                    // binary time code
  401.     
  402. enum {
  403.     NON_DROP_FRAME,
  404.     DROP_FRAME,
  405.     TC_PAL = 0,                // 25 frames per second
  406.     TC_NTSC,                // 30 frames per second
  407.     TC_FILM                    // 24 frames per second
  408.     };
  409.  
  410.     /* function prototype declarations */
  411.     
  412. void StrToBin (StringPtr str,BIN_TC *b, short df, short ntsc);
  413. void BinToStr (BIN_TC *b, StringPtr str);
  414. void BcdToStr (StringPtr str,smpte *bcd);
  415. void BcdToBin (smpte *t, BIN_TC *b, short frameRate);
  416. void BinToBcd (BIN_TC *b, smpte *t, short dur);
  417. void StrToBcd (StringPtr str, smpte *bcd, short frameRate);
  418.  
  419. // START~ Defs-Types
  420.  
  421. //╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  422. // flags for GetVideo
  423.  
  424. enum {
  425.     gvCache            =     0x8000,
  426.     gvOffScreen        =    0x4000,
  427.     gvCacheSingles    =    0x2000,
  428.     
  429.     gvHalfV            =    0x0800,
  430.     gvHalfH            =    0x0400,
  431.     gvFieldsOdd        =    0x0200,
  432.     gvFieldsEven    =    0x0100,
  433.     
  434.     gv1Bit            =    0x0001,
  435.     gv2Bit            =    0x0002,
  436.     gv4Bit            =    0x0004,
  437.     gv8Bit            =    0x0008,
  438.     gv16Bit            =    0x0010,
  439.     gv24Bit            =    0x0018,
  440.     gv32Bit            =    0x0020,
  441.     
  442.     gvNone            =    gv32Bit,
  443.  
  444.     gvDepth            =    0x003F,
  445.     gvFlags            =    0x00FF
  446. };
  447.  
  448. // flags for GetAudio
  449.  
  450. enum {
  451.     ga5kHz            =    0x0001,
  452.     ga11kHz            =    0x0002,
  453.     ga22kHz            =    0x0004,
  454.     ga44kHz            =    0x0008,
  455.     ga48kHz            =    0x0010,
  456.     gaSpecial        =    0x0040,
  457.     gaImage            =    0x0080,
  458.     
  459.     gaStereo        =    0x0100,
  460.     ga16Bit            =    0x0200,
  461.     
  462.     gaDropFrame        =    0x0400,
  463.     
  464.     gaNonLinear        =    0x0800,
  465.     
  466.     gaTwosComp        =    0x1000,
  467.  
  468.     gaCache            =    0x8000,
  469.  
  470.     gaFlags            =    0x0BFF,
  471.     gaRate            =    0x00FF
  472. };
  473.  
  474. //╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  475. // Definitions for filmstrip info record
  476.  
  477. #define filmHasFields 1
  478.  
  479. typedef struct {
  480.     long        signature;                // 'Rand'
  481.     long        numFrames;                // number of frames in the file
  482.     long        duration;                // duration in 30ths
  483.     short        width;                    // image width
  484.     short        height;                    // image height
  485.     short        leading;                // horizontal dead space between frames
  486.     short        framesPerSec;            // frame rate
  487.     long        flags;                    // flag bits
  488.     char        spare[12];                // some spare data.
  489. } FilmStripRec, **FilmStripHand;
  490.  
  491. // START~ Int-Bottlenecks
  492.  
  493. typedef struct {
  494.     Ptr            srcPtr;                    // Pointer to total source block
  495.     long        srcSampleOffset;        // Offset to important part of source (in samps)
  496.     long        srcTotalSampleCount;    // Total samples in source block
  497.     long        srcSampleCount;            // Len of this part of source block (in samples)
  498.     short        srcFlags;                // Format of source block
  499.     Ptr            dstPtr;                    // Pointer to destination block
  500.     long        dstSampleCount;            // Len of destination block (in samples)
  501.     short        dstFlags;                // Format of destination block
  502.     
  503.     long        srcRate;
  504.     long        dstRate;
  505.     long        prevDstSamples;
  506.     long        prevSrcSamples;
  507. } ResampleRec;
  508.  
  509. typedef struct {
  510.     Ptr            srcPtr;
  511.     long        srcSampleCount;
  512.     short        srcFlags;
  513.     
  514.     Ptr            dstPtr;
  515.     long        dstSampleCount;
  516.     short        dstFlags;
  517.     
  518.     long        convertOffset;
  519.     long        step;
  520. } AudioMungeRec;
  521.  
  522. #pragma mpwc off    // In these bottleneck routines, a short really is a short in Premiere, so MPW C calling
  523.                     // conventions must be temporarly turned off.
  524.  
  525. typedef pascal void (*StretchBitsPtr) (BitMap *srcBits, BitMap* dstBits, Rect *srcRect, Rect *dstRect, 
  526.                                        short mode, RgnHandle maskRgn);
  527.  
  528. typedef pascal void (*DistortPolygonPtr)      (GWorldPtr src, GWorldPtr dest, Rect *srcbox, Point *dstpts);
  529. typedef pascal void (*DistortFixedPolygonPtr) (GWorldPtr src, GWorldPtr dest, Rect *srcbox, LongPoint *dstpts);
  530.  
  531. typedef pascal void (*PolyToPolyPtr)   (GWorldPtr src, GWorldPtr dest, Point *srcpts, Point *dstpts);
  532. typedef pascal void (*FixedToFixedPtr) (GWorldPtr src, GWorldPtr dest, LongPoint *srcpts, LongPoint *dstpts);
  533.  
  534. typedef pascal void (*AudStretchPtr) (Ptr src, long srclen, Ptr dest, long destlen, short flags);
  535.  
  536. typedef pascal void (*AudMixPtr) (Ptr buf1, long v1, Ptr buf2, long v2, Ptr buf3, long v3,
  537.                                   long width, Ptr dest, short flags);
  538.  
  539. typedef pascal void (*AudSumPtr)   (Ptr src, Ptr dest, long width, long scale, short flags, long part, long total);
  540. typedef pascal void (*AudLimitPtr) (Ptr src, Ptr dest, long width, short flags, long total);
  541.  
  542. typedef pascal void (*ResamplePtr)   (ResampleRec *theRec);
  543. typedef pascal void (*AudioMungePtr) (AudioMungeRec *theRec);
  544.  
  545. #ifdef AdvancedIncludes
  546.     typedef pascal void (*ImageKeyPtr) (GWorldPtr srcworld, GWorldPtr dstworld, GWorldPtr work,
  547.                                         Ptr workbuf, unsigned short level, TrackRec *therec);
  548. #endif
  549.  
  550. #pragma mpwc reset
  551.  
  552. typedef struct {
  553.     short                        count;                    // number of routines
  554.     short                        reserved[14];
  555.     
  556.     StretchBitsPtr                StretchBits;
  557.     DistortPolygonPtr            DistortPolygon;
  558.     PolyToPolyPtr                MapPolygon;
  559.     AudStretchPtr                AudioStretch;
  560.     AudMixPtr                    AudioMix;
  561.     AudSumPtr                    AudioSum;
  562.     AudLimitPtr                    AudioLimit;
  563.     DistortFixedPolygonPtr        DistortFixed;
  564.     FixedToFixedPtr                FixedToFixed;
  565. #ifdef AdvancedIncludes
  566.     ImageKeyPtr                    ImageKey;
  567. #else
  568.     long                        ImageKey;
  569. #endif
  570.     
  571.     ResamplePtr                    Resample;
  572.     AudioMungePtr                AudioMunge;
  573.     
  574.     long                        unused[1];
  575. } BottleRec;
  576.  
  577. enum {
  578.     bottleStretchBits = 0,
  579.     bottleDistortPolygon,
  580.     bottleMapPolygon,
  581.     bottleAudioStretch,
  582.     bottleAudioMix,
  583.     bottleAudioSum,
  584.     bottleAudioLimit,
  585.     bottleDistortFixed,
  586.     bottleFixedToFixed,
  587.     bottleImageKey,
  588.     bottleResample,
  589.     bottleAudioMunge,
  590.     
  591.     bottleCount
  592. };
  593.  
  594. #ifdef PrPPC
  595.  
  596. enum  {
  597.     uppStretchBitsProcPtrInfo = kPascalStackBased
  598.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(BitMap *)))
  599.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(BitMap *)))
  600.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Rect *)))
  601.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Rect *)))
  602.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(short)))
  603.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(RgnHandle))),
  604.     uppDistortPolygonProcPtrInfo = kPascalStackBased
  605.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(GWorldPtr)))
  606.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(GWorldPtr)))
  607.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Rect *)))
  608.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Point *))),
  609.     uppDistortFixedPolygonProcPtrInfo = kPascalStackBased
  610.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(GWorldPtr)))
  611.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(GWorldPtr)))
  612.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Rect *)))
  613.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(LongPoint *))),
  614.     uppPolyToPolyProcPtrInfo = kPascalStackBased
  615.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(GWorldPtr)))
  616.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(GWorldPtr)))
  617.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Point *)))
  618.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Point *))),
  619.     uppFixedToFixedProcPtrInfo = kPascalStackBased
  620.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(GWorldPtr)))
  621.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(GWorldPtr)))
  622.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(LongPoint *)))
  623.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(LongPoint *))),
  624.     uppAudStretchProcPtrInfo = kPascalStackBased
  625.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  626.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  627.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Ptr)))
  628.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  629.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(short))),
  630.     uppAudMixProcPtrInfo = kPascalStackBased
  631.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  632.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  633.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Ptr)))
  634.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  635.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(Ptr)))
  636.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  637.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long)))
  638.          | STACK_ROUTINE_PARAMETER(8, SIZE_CODE(sizeof(Ptr)))
  639.          | STACK_ROUTINE_PARAMETER(9, SIZE_CODE(sizeof(short))),
  640.     uppAudSumProcPtrInfo = kPascalStackBased
  641.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  642.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  643.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  644.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  645.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(short)))
  646.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  647.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long))),
  648.     uppAudLimitProcPtrInfo = kPascalStackBased
  649.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  650.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
  651.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  652.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  653.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))),
  654. #ifdef AdvancedIncludes
  655.     uppImageKeyProcPtrInfo = kPascalStackBased
  656.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(GWorldPtr)))
  657.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(GWorldPtr)))
  658.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(GWorldPtr)))
  659.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(Ptr)))
  660.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(unsigned short)))
  661.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(TrackRec *))),
  662. #endif
  663.     uppResampleProcPtrInfo = kPascalStackBased
  664.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResampleRec *))),
  665.     uppAudioMungeProcPtrInfo = kPascalStackBased
  666.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(AudioMungeRec *)))
  667. };
  668.  
  669. typedef struct {
  670.     short                        count;                    // number of routines
  671.     short                        reserved[14];
  672.     
  673.     UniversalProcPtr            StretchBits;
  674.     UniversalProcPtr            DistortPolygon;
  675.     UniversalProcPtr            MapPolygon;
  676.     UniversalProcPtr            AudioStretch;
  677.     UniversalProcPtr            AudioMix;
  678.     UniversalProcPtr            AudioSum;
  679.     UniversalProcPtr            AudioLimit;
  680.     UniversalProcPtr            DistortFixed;
  681.     UniversalProcPtr            FixedToFixed;
  682. #ifdef AdvancedIncludes
  683.     UniversalProcPtr            ImageKey;
  684. #else
  685.     long                        ImageKey;
  686. #endif
  687.     
  688.     UniversalProcPtr            Resample;
  689.     UniversalProcPtr            AudioMunge;
  690.     long                        unused[1];
  691. } UPPBottleRec;
  692.  
  693. #endif
  694.  
  695. typedef pascal void (*BottleProc) (short selector, BottleRec *therec);
  696.  
  697. // START~ SUBS-Blocks
  698.  
  699. // Header definition for data blocks
  700. //
  701. // Blocks passed to an export module have a header followed by any
  702. // static data, then any sub-blocks, which themselves have
  703. // headers, static data, and sub-blocks...
  704.  
  705. typedef struct {
  706.     long    size;                    // total size of this block, including static data and sub-blocks
  707.     long    dataSize;                // the static data size for this block
  708.     long    type;                    // the block type (basically, an OSType)
  709.     long    theID;                    // the block ID, for blocks which do not need an ID, 0 is used
  710. } BlockRec;
  711.  
  712. // These are the routines used to build and take apart data blocks
  713.   
  714. void AppendBlock      (BlockRec **dstBlock, BlockRec **srcBlock);
  715. void ExtendBlock      (BlockRec **dstBlock, BlockRec **srcBlock);
  716.  
  717. void NextBlock        (BlockRec **srcBlock);
  718. void ExtractBlockData (BlockRec *srcBlock, void *destination, long *maxlen);
  719.  
  720. long CountTypeBlocks  (long type, BlockRec *srcBlock);
  721.  
  722. BlockRec **BuildBlock (long type, long theID, long length, void *data);
  723. BlockRec *FindBlock   (long type, long theID, long index, BlockRec *srcBlock);
  724. BlockRec **GetBlock   (long type, long theID, long index, BlockRec **srcBlock);
  725.  
  726.  
  727. // START~ SUBS-ClipQ
  728.  
  729. long        ClipStart            (short clipID, short fps);
  730. short        ClipRate            (short clipID);
  731. void        GetClipTitle        (short clipID, StringPtr str, char *alias);
  732. void        SetClipTitle        (short clipID, StringPtr str);
  733. long        ClipSize             (short clipID, short fps);
  734. long        ClipWidth            (short clipID, short fps);
  735. long        GetClipMarker        (short clipID, short marker, short fps);
  736. void        SetClipMarker        (short clipID, short marker, long value, short fps);
  737. void        ClearClipMarkers    (short clipID);
  738. short        ClipFile            (short clipID);
  739. short        ClipFlags            (short clipID);
  740. void        SetClipAspect        (short clipID, short aspect);
  741. short        ClipAspect            (short clipID);
  742. short        CountClipMarkers    (short clipID);
  743. short        FindClipMarker        (short clipID, long value, short fps);
  744. short        PreviousClipMarker    (short clipID, long value, short fps);
  745. short        NextClipMarker        (short clipID, long value, short fps);
  746. short        GetClipBackwards    (short clipID);
  747. void        SetClipBackwards    (short clipID, short backwards);
  748.  
  749. // START~ SUBS-FileQ
  750.  
  751. void        GetFSSpec            (short fileID, FSSpec *thespec);
  752. short        OpenFile            (short theID);
  753. short        OpenRFile            (short theID);
  754. void        ReleaseFile            (short theID);
  755. void        ReleaseRFile        (short theID);
  756. short        CloseUp                (long n);
  757. short        FindFType            (StringPtr name, long dirID, short vRefNum, long *ftype);
  758. void        FileSubscribe        (short fileID);
  759. void        FileCancel            (short theID);
  760. long        GetFileType            (short theID);
  761. long        GetFileDraw            (short theID);
  762. long        GetDrawType            (long filetype);
  763. long        GetHDLRType            (long filetype);
  764. short        GetTypeFlags        (long filetype);
  765.  
  766. // START~ SUBS-Debug
  767.  
  768. void PrDebug (short panel, char *str, ... );
  769.  
  770. // START~ SUBS-Filecopy
  771.  
  772. short FileCopy (FSSpec *src, FSSpec *dst);
  773.  
  774. // START~ SUBS-Local_Utils
  775.  
  776. void SpinCurs (short delay);
  777. void StopCurs (void);
  778. // Beaker move this into Utils.c/h
  779. char WhichCell (Point where, Cell *whichcell, ListHandle thelist);
  780. char CheckStop (void);
  781. char CheckStopUpdate (void);
  782.  
  783. // START~ SUBS-Messages
  784.  
  785. char SpecialGetFile (FSSpec *thespec, short numTypes, OSType *types, StringPtr origName, 
  786.                      short dlgID, long *type);
  787. char SpecialGetFilePreview (FSSpec *thespec, short numTypes, OSType *types, StringPtr origName, 
  788.                             short dlgID, long *type, WindowPtr theWindow);
  789. short LocateCreateFile (short numTypes, SFTypeList typelist, StandardFileReply *reply, StringPtr locateprompt, 
  790.                         StringPtr createprompt, StringPtr origname, char showFree);
  791. void MyPutFile (StringPtr prompt, StringPtr origname, StandardFileReply *reply);
  792. char GetFolder (long *dirID, short *vrefnum, short numtypes, OSType *types, long theID, long dlgID);
  793. char GetFolderOrFile (StandardFileReply *reply, short numTypes, OSType *types, long theID, long dlgID);
  794. char GeneralGetColor (StringPtr prompt, RGBColor *incolor, RGBColor *outcolor);
  795.  
  796. // START~ SUBS-Window
  797.  
  798. void ShowModal    (WindowPtr theWindow);
  799. void DisposeModal (WindowPtr theWindow);
  800.  
  801. // START~ SUBS
  802.  
  803. enum {
  804.     tsDelta =        0x01,
  805.     tsHours =        0x02,
  806.     tsOneHour =        0x04
  807. };
  808.  
  809. enum {                            // flags for BetterNewGWorld
  810.     gwFourPlanes =        1,        // set pixmap cmpCount to 4
  811.     gwKeepLocal =        2,        // allocate in local memory
  812.     gwLockPixels =        4,        // lock down the pixels
  813.     gwExtraRAM =        8        // leave extra memory around
  814. };
  815.  
  816. //========================================================================================
  817. // Types related to the SuperFile package
  818. //========================================================================================
  819. typedef struct {
  820.     short    ref;            // Macintosh file reference number of the file in question
  821.     long    bufSize;        // Size of the readahead buffer in bytes
  822.     Ptr        bufStart;        // The readahead buffer
  823.     Ptr        bufPtr;            // The current location in the readahead buffer
  824.     long    bufPos;            // The file offset of the first byte of our buffer
  825.     long    diskPos;        // The current disk file position
  826. } SuperFileRec, *SuperFilePtr;
  827.  
  828. void        SetFont (long which);
  829. WindowPtr    GetFirstWind (long type);
  830. pascal        char modalfilter (DialogPtr thedialog, EventRecord *event, short *itemhit);
  831. pascal        char notextfilter (DialogPtr thedialog, EventRecord *event, short *itemhit);
  832. pascal        char hoursfilter (DialogPtr thedialog, EventRecord *event, short *itemhit);
  833. pascal        char decimalfilter (DialogPtr thedialog, EventRecord *event, short *itemhit);
  834. short        CenterModal (short theID);
  835. short        CenterModalKeys (short theID);
  836. short        MyModal (WindowPtr overwindow, short theID);
  837. void        SeriousErr (StringPtr str1, StringPtr str2, StringPtr str3, long num);
  838. short        AlertSystem (short type, char hascancel, short str1x, short str1num,short str2x, short str2num);
  839. DialogPtr    MyGetNewDialog (short theID, Ptr storage, WindowPtr behind);
  840. void        DrawCorner (WindowPtr theWindow);
  841. void        MakeClipTitle (short clipID, StringPtr str);
  842. void        NewClipWindTitle (WindowPtr theWindow, short clipID);
  843. long        GetRate (short flags);
  844. void        FixListSize (ListHandle thelist);
  845. void        Long2Rect (LongRect *src, Rect *dst);
  846. void        Rect2Long (Rect *src, LongRect *dst);
  847. void        StringTrunc (StringPtr instr, StringPtr outstr, short width);
  848. void        TruncLength (StringPtr instr, short width);
  849. void        MySetCursor (short theID);
  850. char        IsIncremental (FSSpec *therec);
  851. void        IncrementSpec (FSSpec *therec);
  852. void        NumToQuan (long num, StringPtr str);
  853. void        Time2Str (long frame, StringPtr str, short fps, short flags);
  854. long        Str2Time (StringPtr str, short len, short fps);
  855. void        ParseTimecode (StringPtr src, BIN_TC *timecode);
  856. void        FormatTimecode (BIN_TC *timecode, StringPtr str);
  857. void        StringInABox (short which, Rect *box, short style, short listID, long value1, ... );
  858. Handle        ExpandString (short which, short listID, long value1, ... );
  859. void        MakeClipSnip (short clipID, short theID, StringPtr name);
  860. void        DoExpandString (StringPtr src, short srclength, Handle dst, short *dstlength, long *parms, short listID);
  861. void        OffscreenBox (StringPtr str, long size, Rect *box, short style);
  862. char        GetPrefItem (void *item, long len, long type, long theID, void *initial);
  863. void        SetPrefItem (void *item, long len, long type, long theID);
  864. void        DeletePrefItem (long type, short theID);
  865. void        Color82RGB (Color8 *incolor, RGBColor *outcolor);
  866. void        RGB2Color8 (RGBColor *incolor, Color8 *outcolor);
  867. void        GetWindSpecs (WindowPtr theWindow, Rect *box);
  868. char        exists (StringPtr name, short vrefnum, long dirID);
  869. void        BigSetCValue (DialogPtr thedlg, short item, long value);
  870. long        BigGetCValue (DialogPtr thedlg, short item);
  871. void        BigSetCMax (DialogPtr thedlg, short item, long max);
  872. long        BigGetCMax (DialogPtr thedlg, short item);
  873. void        BigSetCMin (DialogPtr thedlg, short item, long min);
  874. long        BigGetCMin (DialogPtr thedlg, short item);
  875. void        DitherBox (DialogPtr thedlg, Rect *box, RGBColor *thecolor);
  876.  
  877. short SafeNewGWorld (GWorldPtr *theworld, short depth, Rect *box,
  878.                      CTabHandle ctab, GDHandle gdev, GWorldFlags flags);
  879.  
  880. short        BetterNewGWorld (GWorldPtr *theworld, short depth, Rect *box, short flags);
  881. Handle        ExtraNewHandle (long size);
  882. void        GetUserRect (short DITLID, short item, Rect *box);
  883. void        GetStartupRect (short item, Rect *box);
  884. void        PositionWindow (WindowPtr target, Rect *box);
  885. pascal short freeHook (short item, DialogPtr thedlg, void *data);
  886. void        DragRect (Point spot, Rect *box);
  887. short        SafeSetupAIFFHeader (short ref, short channels, unsigned long speed,
  888.                                  short bits, long compression, long numBytes, long numFrames);
  889. short        GetModifiers (EventRecord *theEvent);
  890.  
  891. OSErr SuperFileInit (short ref, long bufferSize, SuperFilePtr superData);
  892. OSErr SuperFileRead (SuperFilePtr superData, long *userCount, Ptr outBuf);
  893. OSErr SuperFileSeek (SuperFilePtr superData, long position);
  894. OSErr SuperFileDispose (SuperFilePtr superData);
  895.  
  896. #define kMaxComments 3
  897.  
  898. Handle        GetComment (Handle text, short item);
  899. void        SetComment (Handle *text, short item, Handle comment);
  900.  
  901. // Used to be BeakerGlue.c stuff
  902. Handle        BuildString (short which, short listID, long value1, ... );
  903. void        UpdateAllWindows (void);
  904. void        MakeWindowForFile (OSType fileType, long reserved, FSSpec *theFile);
  905. void        MakeWindowForTextFile (FSSpec *theFile);
  906.  
  907. // START~ Utils
  908.  
  909. //========================================================================================
  910. // General Macintosh routines
  911. //========================================================================================
  912. #ifndef PrPPC
  913.     typedef pascal void (*UserItemProcPtr) (WindowPtr theWindow, short item);
  914. #endif
  915.  
  916. // Memory
  917. void        LockHHi (void *h);
  918. short        SafeSetHandleSize (void *h, long size);
  919. void        FillMem (void *dest, long count, char value);
  920. char        StructsSame (void *a, void *b, long size);
  921.  
  922. long        GetRowBytes (GWorldPtr theWorld);
  923. Ptr            GetGWorldBase (GWorldPtr theWorld);
  924.  
  925. // Dialogs
  926. void        EnableDItem (DialogPtr theDialog, short item);
  927. void        DisableDItem (DialogPtr theDialog, short item);
  928. void        HiliteDControl (DialogPtr theDialog, short item, short value);
  929. short        GetCValue (DialogPtr theDialog, short item);
  930. void        SetCValue (DialogPtr theDialog, short item, short value);
  931. short        GetGroupVal (DialogPtr theDialog, short first, short last);
  932. void        SetGroupVal (short value, WindowPtr theWindow, short first, short last);
  933. void        DrawDItem (DialogPtr theDialog, short item);
  934. void        GetDRect (DialogPtr theDialog, short item, Rect *box);
  935. void        SetDRect (WindowPtr thewindow, short item, Rect *box);
  936. void        InvalItem (DialogPtr theDialog, short item);
  937. void        GetDType (DialogPtr theDialog, short item, short *itemType);
  938. void        GetDHandle (DialogPtr theDialog, short item, Handle *itemHand);
  939. void        ModifyDItem (DialogPtr theDialog, short item, Handle itemHand, Rect *box);
  940. void        UserItem (DialogPtr theDialog, short item, UserItemProcPtr theProc);
  941. void        FlashControl (DialogPtr theDialog, short item);
  942. void        FrameGrayButton (DialogPtr theDialog, short item, char gray);
  943. void        FrameButton (DialogPtr theDialog, short item);
  944. pascal void ButtonFrame (DialogPtr theDialog, short item);
  945. void        PositionDialog (short theID, Point *where);
  946. char        Validate (DialogPtr theDialog, short item, long min, long max);
  947. void        SetIVal (DialogPtr theDialog, short item, long val);
  948. long        GetIVal (DialogPtr theDialog, short item);
  949. void        SetEText (DialogPtr theDialog, short item, StringPtr str);
  950. void        GetEText (DialogPtr theDialog, short item, StringPtr str);
  951. pascal        void DrawItemBox (DialogPtr theDialog, short item);
  952. pascal        void DrawItemFrame (DialogPtr theDialog, short item);
  953. void        SetCMax (DialogPtr theDialog, short item, short value);
  954. short        GetCMax (DialogPtr theDialog, short item);
  955. void        SetCRef (DialogPtr theDialog, short item, long value);
  956. long        GetCRef (DialogPtr theDialog, short item);
  957. void        SetCAction (DialogPtr theDialog, short item, ProcPtr theProc);
  958. void        SetResCTitle (DialogPtr theDialog, short item, short resID, short strNum);
  959. void        OffsetCSize (DialogPtr theDialog, short item, short h, short v);
  960. void        OffsetControl (DialogPtr theDialog, short item, short h, short v);
  961. void        DrawAControl (DialogPtr theDialog, short item);
  962. void        SafeDrawControl (DialogPtr theDialog, short item, short part);
  963. void        SafeSetCValue (DialogPtr theDialog, short item, short value);
  964.  
  965. // Windows
  966. void        CenterWin2Win (WindowPtr moveWindow, WindowPtr overWindow);
  967. void        CenterWinOffset (WindowPtr theWindow, Rect *box, short h, short v);
  968. void        CenterWindow (WindowPtr theWindow, Rect *box);
  969. void        CenterWindowOnMain (WindowPtr theWindow);
  970.  
  971. // Strings
  972. void        Append (StringPtr str1, StringPtr str2);
  973. void        StrCopy (StringPtr src, StringPtr dst);
  974. char        StringsSame (StringPtr str1, StringPtr str2);
  975. void        TypeToStr (long type, StringPtr str);
  976. short        FindIndString (StringPtr str, short theID);
  977.  
  978. // Graphics
  979. void        FrameErase (Rect *box);
  980. void        SetGray (unsigned short value);
  981. void        SetBackGray (unsigned short value);
  982. void        SetColor (unsigned short red, unsigned short green, unsigned short blue);
  983. void        SetBackColor (unsigned short red, unsigned short green, unsigned short blue);
  984. void        SetColorFace (short face);
  985. void        EraseGrow(WindowPtr theWindow);
  986. short        DepthOf (GrafPtr thePort);
  987. char        pt2GDevice (Point thePoint, GDHandle *theDevice);
  988. char        pt2GDeviceRect (Point thePoint, Rect *theRect);
  989. void        VertCenter (StringPtr str, Rect *box, short spacing);
  990. void        DrawSTRVert (short resID, short strNum, Rect *box, short font, short size, short spacing);
  991. void        PinPt (Point *where, Rect *box);
  992. void        DrawSIC4 (short resID, Rect *box, short mode);
  993. void        DrawICL8 (short resID, GrafPtr thePort, Rect *box);
  994. void        DrawICL8Hand (Handle theicl, GrafPtr thePort, Rect *box);
  995. void        DrawFullICL8Hand (Handle theicl, GrafPtr thePort, Rect *box);
  996. GDHandle    SlotToGD (short slot);
  997. void        SlotToRect (short slot, Rect *box);
  998. char        PtClose (Point pt1, Point pt2);
  999. void        HatchBox (Rect *box);
  1000. CursPtr        GetArrow (void);
  1001. Boolean        EqualColor (RGBColor *color1, RGBColor *color2);
  1002. Boolean        EqualColor8 (Color8 *color1, Color8 *color2);
  1003.  
  1004. // List Manager lists
  1005. short        FindSelect (ListHandle theList);
  1006. void        SetSelect (ListHandle theList, short item);
  1007.  
  1008. // Data lists
  1009. short        DataLookup (short resID, short item);
  1010. short        ReverseLookup (short resID, short value);
  1011. void        DeleteHandItem (short which, void *data, short dataSize);
  1012. void        InsertHandItem (short which, void *data, short dataSize, void *item);
  1013.  
  1014. // Files
  1015. short        DirIDFromPath (StringPtr path, long *dirID, short *vRefNum);
  1016. short        PathFromDirID (long dirID, short vRefNum, StringPtr path);
  1017. short        CountVolumes (void);
  1018. short        GetIndVolume (short which);
  1019. short        GetVolIndex (short ref, short count);
  1020.  
  1021. // Menus
  1022. void        WidenMenu2Box (MenuHandle theMenu, Rect *box);
  1023. void        WidenMenu (DialogPtr theDialog, short item);
  1024. short        GetMenuWidth (MenuHandle themenu);
  1025.  
  1026. // Math
  1027. short        LimitLong (long num);
  1028. long        QuickAbs (long val);
  1029.  
  1030. Fixed FixMulDiv (Fixed value, long mul, long div);
  1031. Fixed FixedDiv (Fixed value, Fixed div);
  1032.  
  1033. #ifdef PrPPC
  1034.     long OSTypeFromPString (Str255 pString);
  1035. #else
  1036. // Inline definitions
  1037. #pragma parameter ROMMoveHHi(__A0)
  1038. pascal void ROMMoveHHi(Handle h)
  1039.     = 0xA064;
  1040.  
  1041. #pragma parameter __D0 ROMStripAddress(__D0)
  1042. pascal Ptr ROMStripAddress(Ptr addr)
  1043.     = 0xA055;
  1044.  
  1045. #pragma parameter __D0 ROMGestalt(__D0, __A1)
  1046. pascal OSErr ROMGestalt(OSType selector, long *response)
  1047.     = { 0xA1AD, 0x2288 }; 
  1048. #endif    // PrPPC
  1049.  
  1050. // Interface-compatibility routines that are different between 68K and PowerPC. On the
  1051. // 68K, these all just call through, so eventually we can just eliminate the callthrough
  1052. // routines and use #defines to make the preprocessor whack the names back to the non-Pr
  1053. // name on the 68K.
  1054. void PrModalDialog (ModalFilterProcPtr filterProc, short *itemHit);
  1055. pascal void PrCustomGetFile (FileFilterYDProcPtr fileFilter, short numTypes,
  1056.     SFTypeList typeList, StandardFileReply *reply, short dlgID, Point where,
  1057.     DlgHookYDProcPtr dlgHook, ModalFilterYDProcPtr filterProc, short *activeList,
  1058.     ActivateYDProcPtr activateProc, void *yourDataPtr);
  1059. pascal void PrCustomPutFile (ConstStr255Param prompt, ConstStr255Param defaultName,
  1060.     StandardFileReply *reply, short dlgID, Point where, DlgHookYDProcPtr dlgHook,
  1061.     ModalFilterYDProcPtr filterProc, short *activeList, ActivateYDProcPtr activateProc,
  1062.     void *yourDataPtr);
  1063. pascal void PrCustomGetFilePreview (FileFilterYDProcPtr fileFilter, short numTypes,
  1064.     SFTypeList typeList, StandardFileReply *reply, short dlgID, Point where,
  1065.     DlgHookYDProcPtr dlgHook, ModalFilterYDProcPtr filterProc, short *activeList,
  1066.     ActivateYDProcPtr activateProc, void *yourDataPtr);
  1067. pascal ComponentResult PrSCSetInfo (ComponentInstance ci, OSType type,
  1068.     SCModalFilterProcPtr scModalFilter, SCModalHookProcPtr scModalHook, long refCon,
  1069.     StringPtr customName);
  1070. extended80 inttox80 (long value);
  1071. extended80 longdoubletox80 (long double value);
  1072. long double x80tolongdouble (extended80 value);
  1073. long x80toint (extended80 value);
  1074. long double pie (void);
  1075. pascal short PrTrackControl (ControlHandle theControl,Point thePoint,ProcPtr actionProc);
  1076. pascal OSErr PrSndNewChannel (SndChannelPtr *chan, short synth, long init,
  1077.     SndCallBackProcPtr userRoutine);
  1078. pascal OSErr PrSndDisposeChannel (SndChannelPtr chan, Boolean quietNow);
  1079. pascal ComponentResult PrSGSettingsDialog(SeqGrabComponent s, SGChannel c,
  1080.     short numPanels, Component *panelList, long flags, SGModalFilterProcPtr proc,
  1081.     long procRefNum);
  1082.